#ifndef VARIABLES_INCLUDED
#define VARIABLES_INCLUDED

#include "defines.h"

struct symbol{
	int taille_var;
	int type_var;
	char * name_var;
	int number_array;
};

struct symbol_table{
	int tmp_type;
	int id;
	struct symbol * symbols;
	int count;
	int MAX;
	struct symbol_table * parent;
};

struct symbol_table * symbol_table_allocate(struct symbol_table * parent);

struct symbol_table * symbol_table_pop(struct symbol_table * actuel);
struct symbol_table * symbol_table_push(struct symbol_table * actuel);
int symbol_find_type(char * s);
struct symbol * symbol_find_var(struct symbol_table * entries, char *s);

/**
 * return 0 if the two var have the same type
 */
int symbol_compare_type(struct symbol_table * table, char * entered_a, char * entered_b);
char * symbol_get_temp_type(struct symbol_table * table, char * entered_a);
struct symbol * get_current(struct symbol_table * table);
struct symbol * stack_symbol(struct symbol_table * table);

void print(struct symbol_table * table);

struct symbol_table * getStackTable();
#endif